package com.kkwrite.regimen.common.entity.dto.login;

import java.io.Serializable;
import java.util.Arrays;

/**
 * Created by Ron on 2018/9/3 17:05.
 *
 * @author Ron
 */
public class InviterInfoDTO implements Serializable {
    private static final long serialVersionUID = 8081613246108572698L;
    private Integer inviteFlag;
    private String inviteCode;

    public boolean isInvalid() {
        if (inviteCode == null && inviteFlag != null) {
            return true;
        }
        if (inviteCode != null && inviteFlag == null) {
            return true;
        }
        return inviteFlag != null && !Arrays.asList(1, 2).contains(inviteFlag);
    }

    public Integer getInviteFlag() {
        return inviteFlag;
    }

    public void setInviteFlag(Integer inviteFlag) {
        this.inviteFlag = inviteFlag;
    }

    public String getInviteCode() {
        return inviteCode;
    }

    public void setInviteCode(String inviteCode) {
        this.inviteCode = inviteCode;
    }

    @Override
    public String toString() {
        return "InviterInfoDTO{" +
                "inviteFlag=" + inviteFlag +
                ", inviteCode='" + inviteCode + '\'' +
                '}';
    }
}
